﻿var application = {
	index		: -1,
	add			: function (scriptURL, onLoadHandler)  
	{
		var script = document.createElement('script');
		script.src = scriptURL;
		script.type = "text/javascript";  
		if (onLoadHandler)
		{ 
			script.onreadystatechange = function () 
			{ 
				if ((script.readyState == 'complete')  || (script.readyState == 'loaded'))
				{
					onLoadHandler();
				}
			} 
			script.onload = onLoadHandler;
		}
		if (DEBUG_MODE==false || confirm('ok?')) document.body.appendChild(script);
		return true;
	} ,
	start		: function () { start(); },
	next		: function ()
	{
		application.index ++; 
		if (application.index < scripts.length)
			return application.add (scripts[application.index], application.next);
		application.onloaded ();
	},
	onloaded	: function ()  
	{ 
		attachWaitInvoke () 
		application.start ();
	},
	begin		: function ()  
	{ 
		application.next ();
	}  
} 

var DEBUG_MODE = false;
var scripts = new Array ();
var pathname = '';// location.pathname;
scripts.push (pathname + "js/xmlextras.js"); 
scripts.push ("/webservices/hippo/include/list/global.js"); 
scripts.push (pathname + "js/methods.js"); 
scripts.push (pathname + "js/mvc.js"); 
scripts.push (pathname + "js/datagrid.js"); 
scripts.push (pathname + "js/mvc.date.js");
scripts.push (pathname + "js/mvc.controller.js");
scripts.push (pathname + "js/mvc.template.manager.js");  
scripts.push (pathname + "js/mvc.users.js"); 
scripts.push (pathname + "js/mvc.rooms.js"); 
scripts.push (pathname + "js/mvc.login.js"); 
scripts.push (pathname + "js/mvc.invoice.js"); 
scripts.push (pathname + "js/mvc.calendar.js"); 
scripts.push (pathname + "js/mvc.eventlog.js"); 
scripts.push (pathname + "js/mvc.navigationbar.js"); 
scripts.push (pathname + "js/mvc.toolbar.js"); 
scripts.push (pathname + "js/mvc.custom.properties.js"); 
scripts.push (pathname + "js/mvc.settings.js"); 
scripts.push (pathname + "js/mvc.event.object.js"); 
scripts.push (pathname + "js/mvc.event.detail.js"); 
scripts.push (pathname + "js/mvc.event.list.js"); 
scripts.push (pathname + "js/mvc.databinder.js"); 
scripts.push (pathname + "js/mvc.event.calendar.js"); 
scripts.push (pathname + "js/error.reporter.js");  
scripts.push (pathname + "js/mvc.event.definitions.js");  
scripts.push ("/fckeditor/fckeditor.js"); 
